﻿<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true" CodeBehind="CadastroCliente.aspx.cs" Inherits="JA.Web.Apresentacao.CadastroCliente" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="cHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">
    <div class="art-Block">
        <div class="art-Block-body">
            <div class="art-BlockHeader">
                <div class="l"></div>
                <div class="r"></div>
                <div class="art-header-tag-icon">
                    <div class="t">Cadastro de Cliente 
                        <asp:Button ID="btnExcell" runat="server" Text="Exportar Excel" OnClick="btnExcel_Click"/>
                    </div>
                </div>
            </div>
            <div class="art-BlockContent">
                <div class="art-BlockContent-tl"></div>
                <div class="art-BlockContent-tr"></div>
                <div class="art-BlockContent-bl"></div>
                <div class="art-BlockContent-br"></div>
                <div class="art-BlockContent-tc"></div>
                <div class="art-BlockContent-bc"></div>
                <div class="art-BlockContent-cl"></div>
                <div class="art-BlockContent-cr"></div>
                <div class="art-BlockContent-cc"></div>
                <div class="art-BlockContent-body">

    <asp:UpdatePanel ID="upnCliente" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabCliente" runat="server" ActiveTabIndex="1">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 100%;">
                            <table style="width: 575px;">
                                <tr>
                                    <td>
                                        C&oacute;digo
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtId" runat="server"></asp:TextBox>
                                        <asp:MaskedEditExtender ID="mskTxtId" runat="server" Mask="9999999" TargetControlID="txtId" PromptCharacter="" />
                                    </td>
                                    <td>
                                        Nome
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtNome" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        CPF
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCPF" runat="server"></asp:TextBox>
                                        <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" Mask="9999999" TargetControlID="txtId" PromptCharacter="" />
                                    </td>
                                    <td>
                                        CNPJ
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtCNPJ" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Button ID="btnPesquisa" runat="server" Text="Pesquisa" OnClick="btnPesquisa_Click" />
                                        <br />
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                    <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                            ImageUrl="~/App_Themes/Padrao/imagens/backoffice/editar.gif" CommandArgument='<%#Eval("IdCliente") %>' />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="IdCliente" HeaderText="ID"/>
                                                <asp:BoundField DataField="Nome" HeaderText="Nome" />
                                                <asp:BoundField DataField="CNPJ" HeaderText="CPF" />
                                                <asp:BoundField DataField="CPF" HeaderText="CPF" />
                                                <asp:CheckBoxField DataField="Ativo" HeaderText="Ativo?" />
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server">
                            <div style="width: 100%;">
                                <table width="100%" style="font-family:Verdana;">
                                    <tr>
                                        <td>
                                            C&oacute;digo:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadId" runat="server" Enabled="False" BackColor="#E0E0E0"></asp:TextBox>
                                       </td>
                                       <td>
                                            Nome Completo:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadNome" runat="server" MaxLength="45" Width="300"></asp:TextBox>
                                         </td>
                                    </tr>
        <tr>
            <td>
            </td>
            <td>
                    <div style="font-size:7pt; font-weight:bold; font-style:italic; color:#404040;" >Nome Completo:</div>
                    <asp:TextBox ID="TextBox1" runat="server" MaxLength="45" Width="300" ForeColor="DarkBlue" Font-Bold="true"></asp:TextBox>
            </td>
            <td>
            </td>
            <td>
                    <div style="font-size:7pt; font-weight:bold; font-style:italic; color:#404040;" >CNPJ:</div>
                    <asp:TextBox ID="TextBox2" runat="server" MaxLength="45" Width="300" ForeColor="DarkBlue" Font-Bold="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                    <div style="font-size:7pt; font-weight:bold; font-style:italic; color:#404040;" >Nome Completo:</div>
                    <asp:TextBox ID="TextBox3" runat="server" MaxLength="45" Width="300" ForeColor="DarkBlue" Font-Bold="true"></asp:TextBox>
            </td>
            <td>
            </td>
            <td>
                    <div style="font-size:7pt; font-weight:bold; font-style:italic; color:#404040;" >CNPJ:</div>
                    <asp:TextBox ID="TextBox4" runat="server" MaxLength="45" Width="300" ForeColor="DarkBlue" Font-Bold="true"></asp:TextBox>
            </td>
        </tr>
       
        
        
                                    <tr>
                                        <td>
                                            CNPJ:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadCNPJ" runat="server" MaxLength="15"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="MaskedEditExtender2" runat="server" 
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                InputDirection="RightToLeft" Mask="999,999,999/9999-99"
                                                TargetControlID="txtCadCNPJ" ClearMaskOnLostFocus="true">
                                            </asp:MaskedEditExtender>
                                       </td>
                                        <td>
                                            Endere&ccedil;o:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadEndereco" runat="server" MaxLength="75" Width="300"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            IE:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadIE" runat="server" MaxLength="45"></asp:TextBox>
                                       </td>
                                        <td>
                                            Número:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadNumero" runat="server" MaxLength="45"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="9999999" TargetControlID="txtCadNumero" PromptCharacter="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            IM:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadIM" runat="server" MaxLength="45"></asp:TextBox>
                                        </td>
                                        <td>
                                            Complemento:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadComplemento" runat="server" MaxLength="45"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            CPF:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadCPF" runat="server" MaxLength="15"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="txtCadCPF_MaskedEditExtender" runat="server" 
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                InputDirection="RightToLeft" Mask="999,999,999-99"
                                                TargetControlID="txtCadCPF" ClearMaskOnLostFocus="true">
                                            </asp:MaskedEditExtender>
                                        </td>
                                        <td>
                                            Cep:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadCEP" runat="server" MaxLength="45"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="txtCadCEP_MaskedEditExtender" runat="server" 
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                Mask="99999-999" TargetControlID="txtCadCEP" 
                                                ClearMaskOnLostFocus="true">
                                            </asp:MaskedEditExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                    </tr>
                                   <tr>
                                        <td>
                                            Email:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadEmail" runat="server" MaxLength="45"></asp:TextBox>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCadEmail" 
                                            ErrorMessage="*" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                             ValidationGroup="Salvar" ></asp:RegularExpressionValidator>
                                        </td>
                                        <td>
                                            Bairro:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadBairro" runat="server" MaxLength="45" Width="300"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            SMS:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadSMS" runat="server"  MaxLength="45"></asp:TextBox>
                                        </td>
                                        <td>
                                            Cidade:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadCidade" runat="server" MaxLength="45" Width="300"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Telefone Residencial:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadTel1" runat="server" MaxLength="20"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="txtCadTel1_MaskedEditExtender" runat="server" 
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                Mask="(99)9999-9999" TargetControlID="txtCadTel1" 
                                                ClearMaskOnLostFocus="true">
                                            </asp:MaskedEditExtender>
                                        </td>
                                        <td>
                                            UF:
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCadUF" runat="server" MaxLength="2">
                                            </asp:DropDownList>
                                        </td>
                                   </tr>
                                   <tr>
                                        <td>
                                            Telefone Comercial:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadTel3" runat="server" MaxLength="20"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="txtCadTel3_MaskedEditExtender" runat="server" 
                                                ClearMaskOnLostFocus="true" CultureAMPMPlaceholder="" 
                                                CultureCurrencySymbolPlaceholder="" CultureDateFormat="" 
                                                CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                Mask="(99)9999-9999" TargetControlID="txtCadTel3">
                                            </asp:MaskedEditExtender>
                                        </td>
                                        <td>
                                            Pa&iacute;s:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadPais" runat="server" Enabled="False" MaxLength="45">Brasil</asp:TextBox>
                                       </td>
                                   </tr>
                                   <tr>
                                        <td>
                                            Telefone Celular:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadTel2" runat="server" MaxLength="20"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="txtCadTel2_MaskedEditExtender" runat="server" 
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                Mask="(99)9999-9999" TargetControlID="txtCadTel2" 
                                                ClearMaskOnLostFocus="true">
                                            </asp:MaskedEditExtender>
                                        </td>
                                        <td>
                                            Contato:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadContato" runat="server" MaxLength="45" Width="300"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Telefone Celular 2:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadTel2b" runat="server" MaxLength="20"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server" 
                                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                Mask="(99)9999-9999" TargetControlID="txtCadTel2b" 
                                                ClearMaskOnLostFocus="true">
                                            </asp:MaskedEditExtender>
                                        </td>
                                        <td>
                                            Respons&aacute;vel:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadResponsável" runat="server" MaxLength="45" Width="300"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Ativo:
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="ckbCadAtivo" runat="server" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align:top;">
                                            Data Cadastro:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltDataCadastro" runat="server"></asp:Literal>
                                        </td>
                                        <td style="vertical-align:top;">
                                            Cadastrado por:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltCadastradoPor" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align:top;">
                                            Data Edi&ccedil;&atilde;o:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltDataEdicao" runat="server"></asp:Literal>
                                        </td>
                                        <td style="vertical-align:top;">
                                            Editado por:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltEditadoPor" runat="server"></asp:Literal>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td colspan="4">
                                            <span style="color:Red;"> (*) Campos Obrigatórios </span><br />
                                            <br />
                                            <br />
                                            <asp:Button ID="btnSalvar" runat="server" Enabled="False" ValidationGroup="Salvar"
                                                OnClick="btnSalvar_Click" Text="Salvar" UseSubmitBehavior="false"/>
                                            &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                                                Text="Cancelar" UseSubmitBehavior="false"/>
                                            <asp:Button ID="btnEditar" runat="server" Enabled="False" 
                                                OnClick="btnEditar_Click" Text="Editar" UseSubmitBehavior="false"/>
                                            &nbsp;<asp:Button ID="btnExcluir" runat="server" Enabled="False" 
                                                OnClick="btnExcluir_Click" Text="Excluir" UseSubmitBehavior="false"/>
                                            &nbsp;<asp:Button ID="btnNovo" runat="server" 
                                                OnClick="btnNovo_Click" Text="Novo" UseSubmitBehavior="false"/>
                                            <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnExcluir" ConfirmText="Confirma a exclus&atilde;o do cliente?">
                                            </asp:ConfirmButtonExtender>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>

            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>

                </div>
            </div>
        </div>
    </div>

</asp:Content>




